package com.itheima.mall.dubbo.api.pms;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mall.dubbo.mapper.pms.PmsProductAttributeCategoryMapper;
import com.itheima.mall.entity.domain.pms.ProductAttributeCategory;
import com.itheima.mall.entity.page.MyPage;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class PmsProductAttributeCategoryServiceImpl extends ServiceImpl<PmsProductAttributeCategoryMapper, ProductAttributeCategory> implements PmsProductAttributeCategoryService {
    @Autowired
    private PmsProductAttributeCategoryMapper attributeCategoryMapper;


    @Override
    public MyPage<ProductAttributeCategory> getPage(Integer pageNum, Integer pageSize) {
        Page<ProductAttributeCategory> attributeCategoryPage = new Page<>(pageNum,pageSize);
        LambdaQueryWrapper<ProductAttributeCategory> lqw =new LambdaQueryWrapper<>();
        attributeCategoryMapper.selectPage(attributeCategoryPage,lqw);
        MyPage<ProductAttributeCategory> myPage = MyPage.init(attributeCategoryPage);
        return myPage;
    }
}
